<template>
  <div class="my">
    <div class="my-header">
      <img src="@/assets/b.webp" width="100%" height="100%" alt />
      <!-- <span>{{userForm.phone}}</span> -->
      <span>{{userForm.nickname}}</span>
      <i class="iconfont icon-you"></i>
    </div>
    <div class="my-main">
      <div class="my-main1">
        <div class="my-main1-box1" v-if="userForm === '经纪人'">
          <p>
            <span>我的回答</span>
            <i class="iconfont icon-you"></i>
          </p>
          <p>
            <span>预约管理</span>
            <i class="iconfont icon-you"></i>
          </p>
        </div>
        <div class="my-main1-box1" v-else>
          <p>
            <span>我的关注</span>
            <i class="iconfont icon-you"></i>
          </p>
          <p @click="goQuestion">
            <span>我的提问</span>
            <i class="iconfont icon-you"></i>
          </p>
          <p>
            <span>我的点评</span>
            <i class="iconfont icon-you"></i>
          </p>
          <p class="one-p">
            <span>我的预约</span>
            <i class="iconfont icon-you"></i>
          </p>
        </div>
      </div>
      <div class="my-main2">
        <p @click="goSecond">
          <span>二手房</span>
          <i class="iconfont icon-you"></i>
        </p>
        <p>
          <span>出租房</span>
          <i class="iconfont icon-you"></i>
        </p>
        <p>
          <span>写字楼</span>
          <i class="iconfont icon-you"></i>
        </p>
        <p>
          <span>商铺</span>
          <i class="iconfont icon-you"></i>
        </p>
        <p @click="outLogin">
          <span class="btn">退出登录</span>
        </p>
      </div>
    </div>
  </div>
</template>

<script>
import { mapState } from "vuex";
export default {
  computed: {
    ...mapState(["userForm"])
  },
  methods: {
    outLogin() {
      window.localStorage.clear();
      this.$router.push("/login");
    },
    goSecond() {
      this.$router.push("/second");
    },
    goQuestion() {
      this.$router.push("/question");
    }
  }
};
</script>

<style scoped>
.my {
  width: 100%;
  height: 100%;
  background: rgb(224, 222, 222);
  display: flex;
  flex-direction: column;
}
.my-header {
  width: 100%;
  height: 70px;
  display: flex;
  justify-content: space-between;
  line-height: 70px;
  padding: 0 15px;
  background: #ccc;
  margin-bottom: 20px;
}
.my-header > img {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  /* margin-top: 30px; */
}
.my-main {
  flex: 1;
  overflow-y: scroll;
  background: rgb(224, 222, 222);
}
.my-main1 {
  width: 100%;
  height: auto;
  background: #fff;
}
.my-main1 > .my-main1-box1 > p {
  width: 100%;
  height: 50px;
  line-height: 50px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #ccc;
  padding: 0 15px 15px 15px;
}
.my-main1 > .my-main1-box2 > p {
  width: 100%;
  height: 50px;
  line-height: 50px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #ccc;
  padding: 0 15px 15px 15px;
}
.my-main2 {
  width: 100%;
  height: auto;
  margin-top: 20px;
  background: #fff;
}
.my-main2 > p {
  width: 100%;
  height: 50px;
  line-height: 50px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #ccc;
  padding: 0 15px 15px 15px;
}
.my-main2 > :last-child {
  height: 80px;
  border-bottom: none;
}
.btn {
  width: 100%;
  height: 50px;
  line-height: 50px;
  text-align: center;
  margin-top: 10px;
  border: 1px solid #ccc;
  border-radius: 12px;
}
</style>